﻿using StoreDemo.Domain.Data;

namespace StoreDemo.Data.Repository
{
    internal class UnitOfWorkFactory : IUnitOfWorkFactory
    {
        private readonly IDatabaseContextFactory _databaseContextFactory;

        public UnitOfWorkFactory(IDatabaseContextFactory databaseContextFactory)
        {
            _databaseContextFactory = databaseContextFactory;
        }

        #region Implementation of IUnitOfWorkFactory

        public IUnitOfWork GetUnitOfWork()
        {
            return new EntityFrameworkUnitOfWork(_databaseContextFactory);
        }

        #endregion
    }
}